import Carousel from '../../../components/Carousel';
import useFetch from '../../../hooks/useFetch';

const Similar = ({ mediaType, id }: any) => {
  const { data, loading, error } = useFetch(`/${mediaType}/${id}/similar`);

  const title = mediaType === 'tv' ? '相似电视剧' : '相似电影';

  return <Carousel title={title} data={data?.results} loading={loading} endpoint={mediaType} />;
};

export default Similar;
